<?php
	
REQUIRE_ONCE 'optparse.php';


$optParser = new OptionParser();
$optParser->addOption( '-b', '--build', 'create', 'create project definition', 'bool' ); 
$optParser->addOption( '-d', '--drop', 'drop', 'drop project definition', 'bool' ); 
$optParser->addOption( '-c', '--config', 'config', 'configure file' );
$optParser->addOption( '-e', '--env', 'env', 'env configure file' );

try {
	list($options, $args) = $optParser->parse( $argv );
}
catch(Exception $ex) {
	echo 'Exception: ',$ex->getMessage(),"\n";
	exit(2);
}


echo 'OPTIONS: ',print_r($options, true),"\n";
echo '   ARGS: ',print_r($argv, true), "\n";

if ( empty($options) && empty($args) ) {
	$optParser->usage();
	exit(0);
}

if ( !(isset($options['env']) && isset($options['config']) && (isset($options['create']) || isset($options['drop']))) ) {
	$optParser->usage();
	exit(1);
}

